<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp" %>
<html>
<head>
    <title>${userType==null?"用户":userType}管理</title>
    <meta name="decorator" content="default"/>
    <script type="text/javascript">
        $(document).ready(function () {

        });
        function page(n, s) {
            $("#pageNo").val(n);
            $("#pageSize").val(s);
            $("#searchForm").submit();
            return false;
        }

        function loadPop(userId) {
            var url = "${ctx}/expert/expertExtendInformation/setExpert/" + userId + "/" + "/money/?/?";
            loadPopBox("修改咨询费用", ["咨询费用（x.xx）"], "设置", url, "get", 400, 200);
            $('#popContent > input[type="button"]').click(
                    function () {
                        submitGet(url);
                    });
        }
    </script>
</head>
<body>
<ul class="nav nav-tabs">
    <c:if test="${user.delFlag=='0'}">
        <li class="active"><a href="#">${userType==null?"专家":userType}列表</a></li>
    </c:if>
    <c:if test="${user.delFlag=='1'}">
        <li class="active"><a href="${ctx}/sys/user/listJJR">${userType==null?"专家":userType}列表</a>
        </li>
        <%--<li>
            <a href="${ctx}/sys/user/${userUrl==null?"formJJR":userUrl}">${userType==null?"用户":userType}列表添加</a>
        </li>--%>
    </c:if>
</ul>
<form:form id="searchForm" modelAttribute="user" action="${ctx}/expert/expertExtendInformation/list"
           method="post"
           class="breadcrumb form-search ">
    <input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
    <input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
    <sys:tableSort id="orderBy" name="orderBy" value="${page.orderBy}" callback="page();"/>
    <ul class="ul-form">
        <li><label>企业：</label>
            <form:select path="institutionId" class="input-xlarge required ">
                <form:options items="${fns:getInstitutionList()}" itemLabel="institutionName"
                              itemValue="id" htmlEscape="false"/>
            </form:select>
        </li>
        <li><label>登录名：</label><form:input path="loginName" htmlEscape="false" maxlength="50"
                                           class="input-medium"/></li>
        <li><label>姓&nbsp;&nbsp;&nbsp;名：</label><form:input path="name" htmlEscape="false"
                                                            maxlength="50" class="input-medium"/>
        </li>
        <li class="btns"><input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"
                                onclick="return page();"/>
        </li>
        <li class="clearfix"></li>
    </ul>
</form:form>
<sys:message content="${message}"/>
<table id="contentTable" class="table table-striped table-bordered table-condensed">
    <thead>
    <th>ID</th>
    <th class="sort-column login_name">${userType}登录名</th>
    <th class="sort-column name">${userType==null?"专家":userType}列表名称</th>
    <th>咨询费用</th>
    <th>电话</th>
    <th>性别</th>
    <th>备注</th>
    <th>注册时间</th>
    <th>登录时间</th>
    <th>费用设置</th>
    <%--<th>是否专家</th>--%>
    <%--<th>操作</th>--%>
    </thead>
    <tbody>
    <c:forEach items="${page.list}" var="user">
        <tr>
            <td>${user.id}</td>
            <td>${user.account}</td>
            <td>${user.name}</td>
            <td onclick="loadPop(${user.id})">${user.consultationMoney}</td>
            <td>${user.phone}</td>
            <td>${user.sex}</td>
            <td>${user.remarks}</td>
            <td>
                <fmt:formatDate value="${user.updateDate}" pattern="yyyy-MM-dd HH:mm:ss"/>
            </td>
            <td>
                <fmt:formatDate value="${user.updateDate}" pattern="yyyy-MM-dd HH:mm:ss"/>
            </td>
            <td>
                <a href="#"
                   onclick="loadPop(${user.id})">费用设置</a>
            </td>
                <%--<td>
                    <c:choose>
                        <c:when test="${user.identity == 'expert'}">
                            是
                        </c:when>
                        <c:otherwise>否
                        </c:otherwise>
                    </c:choose>
                </td>--%>
                <%--<td>
                    <c:if test="${user.delFlag=='0'}">
                        <a href="${ctx}/sys/user/formJJRDetail?id=${user.id}&&userType=${userType==null?"用户":userType}">明细</a>
                        <a href="${ctx}/sys/user/updateUser?id=${user.id}&&userType=${user.userType}"
                           onclick="return confirmx('确认要还原该${userType==null?"用户":userType}吗？', this.href)">还原</a>
                        <a href="#" onclick="clearCache(${user.id})">清除缓存</a>
                    </c:if>
                    <c:if test="${user.delFlag=='1'}">
                        <a href="${ctx}/sys/user/${userUrl==null?"formJJR":userUrl}?id=${user.id}&&userType=${user.userType}">修改</a>
                        <a href="${ctx}/sys/user/delete?id=${user.id}&&userType=${user.userType}"
                           onclick="return confirmx('确认要删除该${userType==null?"用户":userType}吗？', this.href)">删除</a>
                        <a href="#" onclick="clearCache(${user.id})">清除缓存</a>
                        <a href="#" onclick="regIm(${user.id})">注册IM</a>
                        <c:choose>
                            <c:when test="${user.identity == 'expert'}">
                                <a href="${ctx}/sys/user/saveExpert/${user.id}"
                                   onclick="return confirmx('确认${user!=null?user.name:null}取消专家吗？',this.href)">取消专家</a>
                            </c:when>
                            <c:otherwise>
                                <a href="${ctx}/sys/user/saveExpert/${user.id}"
                                   onclick="return confirmx('确认${user!=null?user.name:null}要成为专家吗？',this.href)">成为专家</a>
                            </c:otherwise>
                        </c:choose>
                    </c:if>
                </td>--%>
        </tr>
    </c:forEach>
    </tbody>
</table>
<div class="pagination">${page}</div>
</body>
</html>